# detect.py  （被 subprocess 调用）
import json, random, time

# time.sleep(1)   # 模拟耗时
result = {
    "fps": round(random.uniform(25, 30), 2),
    "latency": round(random.uniform(20, 40), 2)}
# 关键：只打印一行 JSON
print(json.dumps(result))